/**
 * @author Jason Tong
 * @date 2019/4/29 16:53.
 */
class Calculate {

    final double PI=3.1415926;// PI是常量
    private int r;
    public double getArea() {
        return PI* getR() * getR();
    }
    public final void speak() {
        System.out.println("您好，How's everything here ?");
    }

    public int getR() {
        return r;
    }

    public void setR(int r) {
        this.r = r;
    }
}
public class Example5_9 {
    public static void main(String args[]) {
        Calculate a=new Calculate();
        a.setR(10);
        System.out.println("面积："+a.getArea());
        a.speak();
    }
}

